import { Request, Response } from 'express';

const data: any[] = [
  {
    id: 1,
    order: 1,
    merchantName: '中国银行',
    merchantNumber: 18829382832,
    banlance: 1992334.0,
    pendingSettlement: 899.33,
    channelType: '特殊渠道',
    dailyLimit: 999999999.0,
    remainingToday: 18888.0,
    computerNumber: 1232333999,
    switchStatus: Math.ceil(Math.random() * 3),
    lastUpdateTime: '2018-03-20 20:11:46',
    orange: 'orange',
    username: 'xxxx',
  },
  {
    id: 2,
    order: 2,
    merchantName: '中国银行',
    merchantNumber: 18829382832,
    banlance: 1992334.0,
    pendingSettlement: 899.33,
    channelType: '特殊渠道',
    dailyLimit: 999999999.0,
    remainingToday: 18888.0,
    computerNumber: 1232333999,
    switchStatus: Math.ceil(Math.random() * 3),
    lastUpdateTime: '2018-03-20 20:11:46',
    orange: 'orange',
    username: 'yyyy',
  },
  {
    id: 3,
    order: 3,
    merchantName: '中国银行',
    merchantNumber: 18829382832,
    banlance: 1992334.0,
    pendingSettlement: 899.33,
    channelType: '特殊渠道',
    dailyLimit: 999999999.0,
    remainingToday: 18888.0,
    computerNumber: 1232333999,
    switchStatus: Math.ceil(Math.random() * 3),
    lastUpdateTime: '2018-03-20 20:11:46',
    orange: 'orange',
    username: 'yyyy2',
  },
  {
    id: 4,
    order: 4,
    merchantName: '中国银行',
    merchantNumber: 18829382832,
    banlance: 1992334.0,
    pendingSettlement: 899.33,
    channelType: '特殊渠道',
    dailyLimit: 999999999.0,
    remainingToday: 18888.0,
    computerNumber: 1232333999,
    switchStatus: Math.ceil(Math.random() * 3),
    lastUpdateTime: '2018-03-20 20:11:46',
    orange: 'orange',
    username: 'yyyy',
  },
  {
    id: 5,
    order: 5,
    merchantName: '中国银行',
    merchantNumber: 18829382832,
    banlance: 1992334.0,
    pendingSettlement: 899.33,
    channelType: '特殊渠道',
    dailyLimit: 999999999.0,
    remainingToday: 18888.0,
    computerNumber: 1232333999,
    switchStatus: Math.ceil(Math.random() * 3),
    lastUpdateTime: '2018-03-20 20:11:46',
    orange: 'orange',
    username: 'yyyy3',
  },
  {
    id: 6,
    order: 6,
    merchantName: '中国银行',
    merchantNumber: 18829382832,
    banlance: 1992334.0,
    pendingSettlement: 899.33,
    channelType: '特殊渠道',
    dailyLimit: 999999999.0,
    remainingToday: 18888.0,
    computerNumber: 1232333999,
    switchStatus: Math.ceil(Math.random() * 3),
    lastUpdateTime: '2018-03-20 20:11:46',
    orange: 'orange',
    username: 'yyyy4',
  },
  {
    id: 7,
    order: 7,
    merchantName: '中国银行',
    merchantNumber: 18829382832,
    banlance: 1992334.0,
    pendingSettlement: 899.33,
    channelType: '特殊渠道',
    dailyLimit: 999999999.0,
    remainingToday: 18888.0,
    computerNumber: 1232333999,
    switchStatus: Math.ceil(Math.random() * 3),
    lastUpdateTime: '2018-03-20 20:11:46',
    orange: 'orange',
    username: 'yyyy9',
  },
  {
    id: 8,
    order: 8,
    merchantName: '中国银行',
    merchantNumber: 18829382832,
    banlance: 1992334.0,
    pendingSettlement: 899.33,
    channelType: '特殊渠道',
    dailyLimit: 999999999.0,
    remainingToday: 18888.0,
    computerNumber: 1232333999,
    switchStatus: Math.ceil(Math.random() * 3),
    lastUpdateTime: '2018-03-20 20:11:46',
    orange: 'orange',
    username: 'yyyy5',
  },
  {
    id: 9,
    order: 9,
    merchantName: '中国银行',
    merchantNumber: 18829382832,
    banlance: 1992334.0,
    pendingSettlement: 899.33,
    channelType: '特殊渠道',
    dailyLimit: 999999999.0,
    remainingToday: 18888.0,
    computerNumber: 1232333999,
    switchStatus: Math.ceil(Math.random() * 3),
    lastUpdateTime: '2018-03-20 20:11:46',
    orange: 'orange',
    username: 'yyyy6',
  },
  {
    id: 10,
    order: 10,
    merchantName: '中国银行',
    merchantNumber: 18829382832,
    banlance: 1992334.0,
    pendingSettlement: 899.33,
    channelType: '特殊渠道',
    dailyLimit: 999999999.0,
    remainingToday: 18888.0,
    computerNumber: 1232333999,
    switchStatus: Math.ceil(Math.random() * 3),
    lastUpdateTime: '2018-03-20 20:11:46',
    orange: 'orange',
    username: 'yyyy6',
  },
  {
    id: 11,
    order: 11,
    merchantName: '中国银行',
    merchantNumber: 18829382832,
    banlance: 1992334.0,
    pendingSettlement: 899.33,
    channelType: '特殊渠道',
    dailyLimit: 999999999.0,
    remainingToday: 18888.0,
    computerNumber: 1232333999,
    switchStatus: Math.ceil(Math.random() * 3),
    lastUpdateTime: '2018-03-20 20:11:46',
    orange: 'orange',
    username: 'yyyy6',
  },
  {
    id: 12,
    order: 12,
    merchantName: '中国银行',
    merchantNumber: 18829382832,
    banlance: 1992334.0,
    pendingSettlement: 899.33,
    channelType: '特殊渠道',
    dailyLimit: 999999999.0,
    remainingToday: 18888.0,
    computerNumber: 1232333999,
    switchStatus: Math.ceil(Math.random() * 3),
    lastUpdateTime: '2018-03-20 20:11:46',
    orange: 'orange',
    username: 'yyyy6',
  },
  {
    id: 13,
    order: 13,
    merchantName: '中国银行',
    merchantNumber: 18829382832,
    banlance: 1992334.0,
    pendingSettlement: 899.33,
    channelType: '特殊渠道',
    dailyLimit: 999999999.0,
    remainingToday: 18888.0,
    computerNumber: 1232333999,
    switchStatus: Math.ceil(Math.random() * 3),
    lastUpdateTime: '2018-03-20 20:11:46',
    orange: 'orange',
    username: 'yyyy6',
  },
  {
    id: 14,
    order: 14,
    merchantName: '中国银行',
    merchantNumber: 18829382832,
    banlance: 1992334.0,
    pendingSettlement: 899.33,
    channelType: '特殊渠道',
    dailyLimit: 999999999.0,
    remainingToday: 18888.0,
    computerNumber: 1232333999,
    switchStatus: Math.ceil(Math.random() * 3),
    lastUpdateTime: '2018-03-20 20:11:46',
    orange: 'orange',
    username: 'yyyy6',
  },
];

const editData: { [propName: string]: any } = {
  code: 200,
  msg: '保存修改成功',
  status: 'success',
};

const addData: { [propName: string]: any } = {
  code: 200,
  msg: '保存修改成功',
  status: 'success',
};

const setStatus: { [propName: string]: any } = {
  code: 200,
  msg: '保存修改成功',
  status: 'success',
};
const deleteAction: { [propName: string]: any } = {
  code: 200,
  msg: '删除成功',
  status: 'success',
};

export default {
  'POST /api/information/data': (req: Request, res: Response) => {
    res.send(data);
  },

  'POST /api/information/add': (req: Request, res: Response) => {
    res.send(addData);
  },
  'POST /api/information/edit': (req: Request, res: Response) => {
    res.send(editData);
  },
  'POST /api/information/change': (req: Request, res: Response) => {
    res.send(setStatus);
  },
  'POST /api/information/delete': (req: Request, res: Response) => {
    res.send(deleteAction);
  },
};
